<!DOCTYPE html>
<html>

<head>

</head>

<body style="color:#333;padding:3px;overflow-x: auto;">

    <table style="width:100%;" border="1">
        <tr>
            <th colspan="40" style="text-align: center;font-size:16px;">{:db('cg_ti_cate')->where('id',$data.cate_id)->value('title')}</th>
            <th colspan="40" style="text-align: center;font-size:16px;">导出时间：{:date('Y-m-d H:i')};导出人：{:db('employee')->where('id',session('employe_id'))->value('em_name')}</th>
        </tr>
        <tr>
            <th colspan="40" style="text-align: left;">类型：{$data.arealat==1?'经销商类':'网点类'}</th>
        </tr>
    </table>
    <table border="1">
        <tr>
            <th colspan="6">{$data.title}</th>
        </tr>
        <tr>
            <td style="min-width: 120px;width: 120px">分区</td>
            <td>{$data.zoning}</td>
            <td style="min-width: 120px;width: 120px">省份</td>
            <td>{$data.provice}</td>
            <td style="min-width: 120px;width: 120px">城市</td>
            <td>{$data.city}</td>
        </tr>
        <tr>
            <td style="min-width: 120px;width: 120px">申请人</td>
            <td>{$data.cusername}</td>
            <td style="min-width: 120px;width: 120px">职位</td>
            <td>{$data.job}</td>
            <td style="min-width: 120px;width: 120px">状态</td>
            <td>{$data.status_title}{if $data.status2==2}/取消{else}/异动{/if}</td>
        </tr>
        <tr>
            <td style="min-width: 120px;width: 120px">经销商名称</td>
            <td colspan="3">{$data.jxs_title}</td>
            <td style="min-width: 120px;width: 120px">性质</td>
            <td>经销</td>
        </tr>
        <tr>
            <td style="min-width: 120px;width: 120px">编号</td>
            <td>{:html_entity_decode("&nbsp;".$data.sn)}</td>
            <td style="min-width: 120px;width: 120px">原编号</td>
            <td>
                {if $data.old}
                {:html_entity_decode("&nbsp;".db('cg_ti')->where('id',$data.old)->value('sn'))}
                {else}
                无
                {/if}</td>
            <td style="min-width: 120px;width: 120px">{if $data.status2==2}取消{else}异动{/if}后编号</td>
            <td>
                {if $data.new}
                {:html_entity_decode("&nbsp;".db('cg_ti')->where('id',$data.new)->value('sn'))}
                {else}
                无
                {/if}
            </td>
        </tr>
        <tr>
            <td colspan="6">{$data.brief}
            </td>
        </tr>
    </table>
    <table style="width:100%;" border="1">
        <thead>
            <tr>
                <th style="font-size:16px" colspan="40">费用规划内容(金额单位：元)</th>
            </tr>
            <tr style="background-color: rgb(153,204,255);">
                <th class="text-center">状态</th>
                <th class="text-center">审批人</th>
                <th class="text-center">核查结果</th>
                <th class="text-center">序号</th>
                <th class="text-center">明细编号</th>
                <th class="text-center">分区</th>
                <th class="text-center">省份</th>
                <th class="text-center">城市</th>
                <th class="text-center">经销商</th>
                <th class="text-center">系统名称</th>
                <th class="text-center">网点名称</th>
                <th class="text-center">活动执行时间</th>
                <th class="text-center">异动活动执行时间</th>
                <th class="text-center">预计核销时间</th>
                <th class="text-center">{$data.product_title}</th>
                <th class="text-center">三级费用科目</th>
                <th class="text-center">费用支付方式</th>
                <th class="text-center">未税费用金额<br>(申请金额/批复金额/反馈金额)</th>
                <th class="text-center">是否增值税</th>
                <th class="text-center">税率</th>
                <th class="text-center">含税费用金额</th>
                <th class="text-center">实际投入费用</th>
                <th class="text-center">已核销金额</th>
                <th class="text-center">预计销量</th>
                <th class="text-center">预计费用率</th>
                <th class="text-center">实际销量</th>
                <th class="text-center">销售达成率</th>
                <th class="text-center">2SR基准销量</th>
                <th class="text-center">基准销量</th>
                <th class="text-center">预计ROI</th>
                <th class="text-center">备注</th>
                <th class="text-center">异动原因</th>
                <th class="text-center">取消原因</th>
                <th class="text-center">费用计入部门</th>
                <th class="text-center">计入部门修改人</th>
                <th class="text-center">费用计入方案</th>
                <th class="text-center">计入方案修改人</th>
                <th class="text-center">收款方</th>
            </tr>
        </thead>
        <tbody>

            <?php $index = 0; ?>
            {volist name="data.list" id="rr" key="k"}
            {volist name="rr._child" id="row"}
            <?php $index ++; ?>
            <tr {if $row.status==1}style="color:green;"{/if}>
                <td>{if $row.status==0}正常{elseif $row.status==1}<font color="green">异动</font>{elseif $row.status==2}<font color="red">取消</font>{/if}</td>
                <td>{$row.eauser_title}</td>
                <td>{$row.earesult}</td>
                <td>{$index}
                </td>
                <td>{$data.sn}_{$row.sn}</td>
                <td>{$zoning}</td>
                <td>{$provice}</td>
                <td>{$city}</td>
                <td>{if $row.jxs_title}{$row.jxs_title}{/if}</td>
                <td>系统名称</td>
                <td>{if $row.net_id}{$row.net_title}{/if}</td>
                <td>从{:date('Y-m-d',$row.start)}至{:date('Y-m-d',$row.end)}</td>
                <td>
                    {if $row.ydstart&&$row.ydend}
                    从{:date('Y-m-d',$row.ydstart)}至{:date('Y-m-d',$row.ydend)}
                    {/if}
                </td>
                <td>{:date('Y-m-d',$row.expCanTime)}</td>
                <td>{$row.productlatval}</td>
                <td>{$row.feetype}</td>
                <td>{$row.paymethod_title}</td>
                <td>{$row.amount}</td>
                <td>{if $row.isVAT==1}是{else}否{/if}</td>
                <td>{$row.shuilv}%</td>
                <td>{$row.hanshui}</td>
                <td>{$row.fb_shijitourufeiyong}</td>
                <td>{$row.hx_yihexiao}</td>
                <td>{$row.totalExpectedSales}</td>
                <td>{$row.yujifeiyonglv}%</td>
                <td>{$row.fb_shijixiaoliang}</td>
                <td>{$row.xiaoshoudachenglv}%</td>
                <td>{$row.2srjizhun}</td>
                <td>{$row.totalBenchmarkSales}</td>
                <td>{$row.yujiroi}%</td>
                <td>{$row.brief}</td>
                <td>{$row.ydreason}</td>
                <td>{$row.qxreason}</td>
                <td>{$row.jrbm}</td>
                <td>{$row.jrbm_puser_name}</td>
                <td>{$row.jrbm_dp}</td>
                <td>{$row.jrbm_dp_puser}</td>
                <td>{if $row.payee==0}(经销商){$row.jxs_title}{else}(供应商)待做{/if}</td>
            </tr>
            {/volist}
            <tr class="trTotal1 font-bold text-right">
                <td colspan="5">小计</td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td>{$rr.st_amount}</td>
                <td></td>
                <td></td>
                <td>{$rr.st_hanshui}</td>
                <td>{$rr.st_shijitourufeiyong}</td>
                <td>{$rr.st_yihexiao}</td>
                <td>{$rr.st_yujixiaoliang}</td>
                <td>{$rr.st_yujifeiyonglv}%</td>
                <td>{$rr.st_shijixiaoliang}</td>
                <td>{$rr.st_xiaoshoudachenglv}%</td>
                <td>{$rr.st_2srjizhun}</td>
                <td>{$rr.st_jizhunxiaoliang}</td>
                <td>{$rr.st_yujiroi}%</td>
                <td colspan="8"></td>
            </tr>
            {/volist}
        </tbody>
        <tfoot>
            <tr>
                <td colspan="5">合计</td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td>{$data.amounts}</td>
                <td></td>
                <td></td>
                <td>{$data.hanshui}</td>
                <td>{$data.shijitourufeiyong}</td>
                <td>{$data.yihexiao}</td>
                <td>{$data.yujixiaoliang}</td>
                <td>{$data.yujifeiyonglv}%</td>
                <td>{$data.shijixiaoliang}</td>
                <td>{$data.xiaoshoudachenglv}%</td>
                <td>{$data.2srjizhun}</td>
                <td>{$data.jizhunxiaoliang}</td>
                <td>{$data.yujiroi}%</td>
                <td colspan="8"></td>
            </tr>
        </tfoot>
    </table>
    <table border="1">
        <tr>
            <th colspan="16">
                本申请中包含{if $data.net_cnt}{$data.net_cnt}个网点，{/if}{if $data.brand_cnt}{$data.brand_cnt}个品牌，{/if}{if $data.category_cnt}{$data.category_cnt}个品类，{/if}{if $data.category_cnt}{$data.category_cnt}个品类，{/if}{if $data.series_cnt}{$data.series_cnt}个系列，{/if}{if $data.sku_cnt}{$data.sku_cnt}个sku，{/if}{if $data.product_cnt}{$data.product_cnt}个单品，{/if}{if $data.feetype_cnt}{$data.feetype_cnt}个三级费用科目，{/if}其中{volist name="fei" id="f"}{$f.title}:{$f.jine}元;{/volist}总预计费用:{$data.hanshui}元;总预计销量:{$data.yujixiaoliang}元;总预计费用率:{$data.yujifeiyonglv}%;总ROI:{$data.yujiroi}%;
            </th>
        </tr>
    </table>
    <table border="1">
        <tr>
            <th colspan="16" style="background-color: rgb(153,204,255);">审批意见</th>
        </tr>
        {volist name="logs" id="l"}
          <tr>
              <td colspan="16">{$l.USERNAME} 审批动作：{$l.MEMO}；审批意见：{if $l.COMMENTS}{$l.COMMENTS}{else/}无{/if}(审批时间：{$l.ACTIONTIME})</td>
          </tr>
          
          {/volist}
       
    </table>

</body>

</html>
